import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatopenMiniappUsersController } from '../../../controllers';
const uctoowechatopenMiniappUsersRouter = new Router();
const wechatopenMiniappUsersController = new uctooWechatopenMiniappUsersController();

uctoowechatopenMiniappUsersRouter.post('/add', requireUser, wechatopenMiniappUsersController.add);
uctoowechatopenMiniappUsersRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechatopen_miniapp_users'), wechatopenMiniappUsersController.edit);
uctoowechatopenMiniappUsersRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechatopen_miniapp_users'), wechatopenMiniappUsersController.delete);

//For getting wechatopenMiniappUsers with permission control
uctoowechatopenMiniappUsersRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechatopen_miniapp_users'), wechatopenMiniappUsersController.getSingle);
uctoowechatopenMiniappUsersRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechatopen_miniapp_users'), wechatopenMiniappUsersController.getMany);
uctoowechatopenMiniappUsersRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechatopen_miniapp_users'), wechatopenMiniappUsersController.getMany);

//#endregion AutoCreateCode
export default uctoowechatopenMiniappUsersRouter;
